<?php defined('IN_ADMIN') or exit('No permission resources.');?>
<?php include $this->admin_tpl('header', 'admin');?>
<script type="text/javascript">
$(document).ready(function() {
	$.formValidator.initConfig({
		formid: "myform",
		autotip: true,
		onerror: function(msg, obj) {
			window.top.art.dialog({
				content: msg,
				lock: true,
				width: '200',
				height: '50'
			})
		}
	});
	$("#name").formValidator({
		onshow: "<?php echo L('input').L('contest_award_name')?>",
		onfocus: "<?php echo L('input').L('contest_award_name')?>"
	}).inputValidator({
		min: 1,
		onerror: "<?php echo L('input').L('contest_award_name')?>"
	});





});
</script>
<div class="pad-10">

	<form name="myform" action="?m=contest&c=winner&a=add" method="post"
		id="myform" enctype="multipart/form-data">
		<input type="hidden" name="data[contest_id]" value="<?=$contest_id?>">

		<div class="content pad-10" id="show_div_1" style="height: auto">
			<fieldset>
				<legend><?php echo L('contest_winner_info')?></legend>
				<table width="100%" class="table_form">
					<tr>
						<td width="120"><?php echo L('contest_winner_name')?>：</td>
						<td><input type="text" name="data[name]" id="name"
							class="input-text" value="" />
						<?php echo form::select_default($moto,null,' name="data[talent_id]" id="talent_id" ','请选择获奖者')?>
						<script>

							$('#talent_id').change(function(){
								var select=$(this).children('option:selected').val();
								if(select!=""){
									var name=$(this).children('option:selected').html();
									$("#name").val(name);
								}

							})

						</script>
						</td>
					</tr>





					<tr>
						<td width="120"><?php echo L('contest_winner_award')?>：</td>
						<td>
							<select name="data[award_id]">
								<?php
								foreach ($this->award as $k=>$v) {
									?>
									<option value="<?php echo $k;?>">
										<?php echo $v?>
									</option>
									<?php
								}
								?>
							</select>
						</td>
					</tr>



					<tr>
						<td width="120"><?php echo '人物横向图'?>：</td>

						<td><?php echo form::images('data[image_horizontal]', 'image_horizontal', '', 'contest', '', 40)?></td>
					</tr>

					<tr>
						<td width="120"><?php echo '人物纵向图'?>：</td>

						<td><?php echo form::images('data[image_vertical]', 'image_vertical', '', 'contest', '', 40)?></td>
					</tr>

					<tr>
						<td width="120"><?php echo L('image_square')?>：</td>

						<td><?php echo form::images('data[image_square]', 'image_square', '', 'contest', '', 40)?></td>
					</tr>


				</table>
			</fieldset>


		</div>
		<div class="bk15"></div>
		<input type="submit" class="dialog" id="dosubmit" name="dosubmit"
			   value="<?php echo L('submit')?>" />

	</form>

</div>
</body>
</html>